<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <form action="./api/getmoney.php">
    <input type="text" name="id" id="cardId" readonly style="display: none;">
    金额：<input type="text" name="money">
    <button>取钱</button>
  </form>
  <script>
    var id = location.search.slice(4)
    console.log(id)
    // 目前阶段像后端发送数据用表单，所以id也得写到form里去，以后就有更好的方案了
    document.querySelector('#cardId').value = id
  </script>
</body>
</html>